//
//  XBHome.m
//  Home
//
//  Created by 陈明茂 on 16/3/27.
//  Copyright © 2016年 iOS. All rights reserved.
//

#import "XBHome.h"

@implementation XBHome

+ (NSArray *)home{
    
    NSArray *sourArr = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"home.plist" ofType:nil]];
    NSMutableArray *desArr = [NSMutableArray arrayWithCapacity:sourArr.count];
    
    [sourArr enumerateObjectsUsingBlock:^(NSDictionary *dic, NSUInteger idx, BOOL * _Nonnull stop) {
        
        XBHome *home = [XBHome homeWithDict:dic];
        [desArr addObject:home];
    }];
    return [desArr copy];
}

- (instancetype)initWithDict:(NSDictionary *)dict {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+ (instancetype)homeWithDict:(NSDictionary *)dict {
    return [[self alloc] initWithDict:dict];
}


@end
